<template>
	<el-drawer title="联系人详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="联系人" prop="linkName">{{form.linkName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="关联客户" prop="customerId">{{form.cnName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="性别" prop="sex">
								<el-tag type="primary" size="small" v-if="form.sex==='1'">男</el-tag>
								<el-tag type="danger" size="small" v-else-if="form.sex==='0'">女</el-tag>
								<el-tag type="info" size="small" v-else>保密</el-tag>
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="出生日期" prop="birthday">{{form.birthday}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="手机号" prop="mobile">{{form.mobile}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="电子邮件" prop="email">{{form.email}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="部门" prop="deptName">{{form.deptName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="职务" prop="post">{{form.post}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="决策人" prop="decisionMaker">
								<el-tag type="primary" size="small" v-if="form.decisionMaker==='1'">是</el-tag>
								<el-tag type="danger" size="small" v-else-if="form.decisionMaker==='0'">否</el-tag>
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="上级领导" prop="leadName">{{form.leadName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="电话" prop="tel">{{form.tel}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="传真" prop="fax">{{form.fax}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="爱好" prop="hobby">{{form.hobby}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="通讯地址" prop="address">{{form.address}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明" prop="remark">{{form.remark}}
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	components: {
	},
	data() {
		return {
			loading: false,
			form: {
				linkManId: '',
				linkName: '',
				cnName: '',
				sex: '1',
				email: '',
				mobile: '',
				deptName: "",
				post: "",
				birthday: '',
				decisionMaker: '1',
				leadName: '',
				tel: '',
				fax: '',
				hobby: '',
				address: '',
				remark: ''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form.linkManId = data.linkManId
			this.form.linkName = data.linkName
			this.form.cnName = data.cnName
			this.form.sex = data.sex
			this.form.email = data.email
			this.form.mobile = data.mobile
			this.form.deptName = data.deptName
			this.form.post = data.post
			this.form.birthday = data.birthday
			this.form.decisionMaker = data.decisionMaker
			this.form.leadName = data.leadName
			this.form.tel = data.tel
			this.form.fax = data.fax
			this.form.hobby = data.hobby
			this.form.address = data.address
			this.form.remark = data.remark
		}
	}
}
</script>

<style>
</style>
